start implementation of weighted markov chain