you have to peek the character instead of using nextChar. there is no such so you have to create one.