Used HMM class for functions in forwardsbackwards. Need to implement viterbi algorithm