added tree hashing functions