for each changed to iterator