Finished Sorting Functionality