Add word count function