with hash table