added a word count function of sorts