Basic markov chain impl