old implementation of markov chain text generator