added line drawing algorithm