make viterbi code up to date and uses LGDictModule