removed terminal_writestring to be replaced with printf.  Now supports newlines