added grid, optimized redraw