moving for loop