towards Viterbi in HMM