updated hashing function