Added code to estimate probability parameters.