implementing the grid_classes macro