update the grid