refactor markov example for week 4
refactor markov and add cfg examples