HMM code updated for both discrete and GMM emissions