public GeneralPath generateGrid(int numCells) {
        GeneralPath grid = new GeneralPath();
        for (float i = 0; i <= width; i += cellSize / numCells) {
            grid.moveTo(i, 2);
            grid.lineTo(i, height);
        }

        for (float i = 0; i <= height; i += cellSize / numCells) {
            grid.moveTo(2, i);
            grid.lineTo(width, i);
        }

        return grid;
    }