Well it should work just like that, so that line is not your issue, but they are right, either increment it after that line, or at the end of the loop