Simplified logic for reading and writing a single character