added psuedo-hash

does redundant state checks. not sure if it'll cause memory to overflow
though, it'll be adding a lot of space.
Fixed type errors + hash

shouldn't crash during iteration, hash should also work now (not sure
how often it will come up though)