HMM.py completed