Resetting value of i as earlier loop can remain in the editor