Add Viterbi algorithm