Define the hash_compare function if it doesnt already exist