add nextChar implementation