Initial crude processing code for (sorta) Markov chain-like learning.