Fixed for loop

reworked for loop