Added a new function to type which char to count and fixed some minor issues.