major progress on markov; minor improvements