for loops rearrange