Finished sorting for Part B