implemented quadgrams