Revert "SortMatrix problems"

This reverts commit 9c00a9e6c2c2457740deef621f1952582baf73c0.