made new constrcutor for Bayesian Networks