Resort after weeding out duplicates