fixed the long remaining bug
changed to self generating markov chain