change terminal_write to terminal_puts, etc ...