re-do of markov exercise