revert to old _hmm since recent changes too unstable