example of markov chain generation and traversal