refactored markov to use redis