Refactored individual sort into SortLib