implements hash table and tests