completed implementation and added hmm inference test