returns the words for query