both HMM and change to source code