refactored addWord
refactored addWord