added first version of HMM