update A & B grids