updating trigram prediction