add basic dedupe function