Formatting and for loop fixes. 

some for loops were missing the initial variable statement