further work on hmm