I added a hashing function and some code to hash the state and store in a hashtable. Have not tested it.