Changed for loop to iterator.