testing code in NewGrammar