Removed countCharInString() and replaced its invocations with