adding utility for counting character occurences in a string