Added Viterbi algorithm