Added hash function.