optimized trigram