change interface of viterbi function