Version 1.2: Added my_countchar function