Shorten code used in example markov chain