changed the for loop section