Added functionality to markov.py