Adjusted code generation for console reading.