Fixed line breaks, and made a copy of the lines to sort.