Added Markov Chaining functionality

added

Added Markov Chaining functionality