started to define the fuction for the word count