Correctly adding the number of duplicates found