added rest of the for loops