calculate the grid products