changed markov_chain data structure to map