new algorithm to find words to add