optionally find duplicate values