implement markov transition matrices, 2nd order too inefficient