added tests and implementation of grid definitions