Corrected coding style (cont.)

corrected for loop