Trimmed a few lines from the original and created a nicer looking script in csv_sorter2.pl