added sortWords() and getWordsLength()