fixed line drawing algorithm, GT: little changes