add viterbi algorithm