Corrected sorting mishap