First implementaion of code to render lines to the buffer