add word-count function