implemented bresenham interger algorithm