add code for probabilistic model