I understood how the code works, I asked if you have confirmed that those two variables have the expected values after the loop.

You write that "i" has the value 1, which, if taken after the loop, would mean the loop ran one iteration.

Cheers,
_