sort on unique depths