changed for loop section