Added remove-duplicates functionality