updated NGram function