Sort lines