added a simple hashing function