Reverse order of loop