first functioning version of markov generator