small changes to viterbi. Added grammar.py