add code for beta prior