cleaned up markov.py file