fix hash table algorithm