Updated code for new hashing function