fixed #7. Iterative

changed variable used