Added remove duplicates using hash logic