Bug Fixed

I don't believe the for loop index can be modified. Probably not the cleanest solution, but I think I got this working how you wanted.