added Iterator to be used instead of for loop