Viterbi fully working for generic 1/n codes