Sorting works on both axes. Positioning based on size of matrix.