Added code to iterate over objects in each method