rearrange x and y