markov chain improvements and fixes