replaced hashmap with hashset