corrected more for changed values in grid.class