@Override
    public void acceptButtonActionPerformed() {
        //Comprobation that closuredTo is a double value is needed
        try{

            String selectedNames[] = ds.getSelectedData();
            DataFrame dataFrame = mainApplication.getActiveDataFrame();

            boolean selection[] = dataFrame.getValidCompositionsWithZeros(selectedNames);
            
            double dlevel[][] = dataFrame.getDetectionLevel(selectedNames);
            double[][]data = dataFrame.getNumericalData(selectedNames);
            
            double[][]vdata = coda.Utils.reduceData(data, selection);

            double power = Double.parseDouble(powerWith.getText());

            String[] new_names = new String[selectedNames.length];
            for(int i=0;i<selectedNames.length;i++) new_names[i] = selectedNames[i] + "^" + Double.toString(power);

            // = CoDaPack.center(df.getNumericalDataZeroFree(sel_names));
            double[][] dpow = CoDaStats.powerData(vdata,power);
                        
            if(performClosure.isSelected()){
                double vclosureTo = Double.parseDouble(closureTo.getText());
                double[][]d = coda.Utils.recoverData(CoDaStats.closure(dpow, vclosureTo), selection);
                
                double []total = CoDaStats.rowSum(data);
                for(int i=0;i<new_names.length;i++){
                    Variable var = new Variable(new_names[i], d[i]);
                    for(int j=0;j<data[i].length;j++){
                        if(dlevel[i][j] != 0 & data[i][j] == 0){
                            var.set(j, new Zero(  Math.pow(dlevel[i][j]/total[j], power)  ));
                        }
                    }
                    dataFrame.addData(new_names[i], var);
                } 
            }else{
                double[][]d = coda.Utils.recoverData(dpow, selection);
                for(int i=0;i<new_names.length;i++){
                    Variable var = new Variable(new_names[i], d[i]);
                    for(int j=0;j<data[i].length;j++){
                        if(dlevel[i][j] != 0 & data[i][j] == 0){
                            var.set(j, new Zero(  Math.pow(dlevel[i][j], power) ));
                        }
                    }
                    dataFrame.addData(new_names[i], var);
                } 
            }

            mainApplication.updateDataFrame(dataFrame);
            setVisible(false);
        }catch(NumberFormatException ex){
            JOptionPane.showMessageDialog(this, "Power value must be a double");
        }
        
    }