HMM fixed & working properly