char counting function complete!