working with markov