implemented markov chains