Viterbi implemented and corrected.