Wrote the charCount() function.