“Sorting Multidimensional Types: Theory and Application”