First functional version of the Markov chain, learns everything.