for loop modified