started implementing Viterbi algorithm