some improvements in the grid fitter