all bayes net code