New code that draws lines and error