Made slight modifications to ngram