Functioning check-for-duplicates test