Still errors, but basic HMM implementation and plotting