deleting duplicates - masks