Sorting 2D and 3D shapes 1b