using for each and for loop to iterate over array