adds to_factor method in BayesianModel
improved Inference class