improve hashing; various changes