optimizing word lookups