Fixed the line-drawing algorithm