Rearanging lines