I didn´t go through your code in detail but isn´t your hash map implementation very slow? I always thought that one of the main points of hash maps is very fast look-up of keys? They often use some kind of tree structure for that.