update for loop