changed out for loop