frequency working for markov chains