some markov chain generator stuff