Corrected msort