drawing line algorithm fixed and minor changes