replaced the iterator by a for loop for legibility