added separate chaining to resolve hashtable collisions