update implementation of hash