Created the logic to draw the lines