folding in markov chaining
updates from my branch