Made changes to Sorter code