Change the for-loops around