Implemented addWord method