cleaning up markov.py