Added newline handling and scrolling when the bottom of the screen is reached.