updating ngram.cpp