Implemented the gridSize variable, to keep the size editable