added word count function