Iterating through a list to detect words.