add word count function and test