inline teh three special function for viterbi, and let the general case handle nonzero residues
(fights pass)