Fixed unnessary computations to account for higher order markov chains