implemented generating nodes for markov chain algorithm