update viterbi and reindent hmm