Cooling by Sorting