fixed gale church implementation so doctests work; used log probabilities instead of raw probabilities for the distance function to improve accuracy