Changed algorithm Viterbi

Changed of algorithm Viterbi. Modified of HMM.