public boolean setCell(int row, int col) {
        if (row < 3 && row >= 0 && col >= 0 && col < 3) {
            if (grid[row][col] == null) {
                grid[row][col] = (currentMove == Move.X) ? Move.X : Move.O;
                if (currentMove == Move.X) {
                    currentMove = Move.O;
                } else if (currentMove == Move.O) {
                    currentMove = Move.X;
                }
                updateStatus();
                return true;
            }
        }
        return false;
    }