Added remove duplicates function to helper