change to trigram implementation