added hashing code