I think I have the answer now, but if someone could clarify that would be helpful.
I think what the code is doing is trying to add a collection to an object - which obviously won't work. So I need to create a collection which I can add the object AND the collection to. etc.