First draft of Viterbi