fix errors up to bresenham