added Bayesian functions.