sort matrix where rows and columns are sorted
rm some stuff