adds logic to highlight words in a story