update for viterbi