Changing the hit calculation function.