added weighted viterbi