improved input/output character example