mhash replaced with hash function