build the for loop