sorting the wordList by priority