Added code for Distribution and Stochastic Nodes