added hashMap data structure to store words