changing generate structure. Keep comments in markov.py