simple implementation of discrete observation HMM