change state to use hashing function