Update HMM related code following reviewers feedback
Add constructor for Matrix class