a simple python markov chain implementation