added ngram fn