Change the sort routine not to rely on column headers having distinct values