Viterbi reduced to 2 cases and 11 lines of code