Fixed some warnings and moved nodeMap and bn to BayesianNet class instead of local variables