rearrange lines