Simplified function bayesNodes