Using loops to print out info about objects within an array