FEATURE: References are sorted so that duplicates are easier to detect.