ngram algo is working