changed the return value of searchWordList function