Added code to solve #1 for object examples