I would remove this variable, and use just i inside the for as it is explained in the next comment