hash table sortof works but not quite bugfree