Reorganise the blocks into the correct order