Added methods matchPattern, buildPattern, and a helper method updateCheckedWords. Added test cases of the the helper method updateCheckedWords.