creating markov class