implement ViterbiAlignment