Transition table training function complete (though not particularly efficient…)