Memory management  and implement copy an object