getDuplicates function

Gets the duplicates from data