bresenham line algorithm for homework