switched for loop places