Changed how instVar is called
Implemented sampling algorithm for Bayesian Networks