migrated from ViterbiThree to V4
fix bug in latest viterbi, but I am still not sure it is right