NEW SORT FUNCTIONALITY