Rearange lines