Fixup for loops to actually use variable

I'm honestly not sure how it worked before, if at all