Improved addWord method, added separate checkWord method