added "constants" for dims and parameterized grid ctor by dims