hmm_demo written