Added char count function.