Adding the union function for objects