updated MatrixSorter