Wrote wordCount() function.