modified code to use java hash table