not pretty but basic hash table working, untested