first solution to object set assignment