Complete documentation of markov.py