Ah, there it is. The realization that all of this code can be completely trashed and I can just do the entire thing with markov chains instead. #math