Welcome to Code Ranch Please ask specific question. Should we explain the code sample or the errors in it. Can you post what error you came across when you tried & what resolution you need.
Ok... just to give help on 3rd, the reference should point to a single object.