[UPDATE] a refactor + fixed tuple bug in hashing

Stupid stupid stupid tuple bug