adjusted control flow for wordsearch, comments on problem 3