Fixing bug where the word count was being incorrectly calculated after making the words array as a named array