Use rank sorting in unite