remove and sort