yeah that does fix it.
A recommendation before you venture any further and this will help you work and understand things better; as you've got an assortment of different peoples code and naming conventions ( nothing wrong in that for learning ) Tidy up the code you currently have, also name the variable to things you will signify the meaning of them better by. I'll post up an example of what I mean, if you want it. As changing the for loop to a 1 does correct it.