trying to get the viterbi algorithm working