more viterbi stuff