updated MatrixSorter.java