added calc and beginning of markov2