finalized duplicates function