Properly use iterator