Viterbi algorithm now passing basic sanity checks