build_HMM() in HMM_IO.py