fix some indentations 

these two if statements are parts of the function not the loop