defined word count method