Altered markov implementation because I gone mucked things up.