adding function to count words in markdown files