using a hash function