added hash function.