Add bayesian code