modified console_writer.py