add basic C++ version of markov