finish hmm train module