public void exec(int[] initialValues, SortingMethod method1,SortingMethod method2) {
     //Step[][] steps = method.solve(initialValues);
     //this.setVisible(false);
     //new SimulationFrame(steps);
      
       //checks to see if data is acceptable
       //   *length 1-15
       //   *min value 1, max value 50
       //-Quy
       boolean goodToGo = true;
       int i;
       for(i=0; i<initialValues.length; i++){
            if(initialValues[i] < 1 || initialValues[i] >50){
                JOptionPane.showMessageDialog(this,"Please enter values between 1 and 50",
                                                 "Invalid Input",JOptionPane.WARNING_MESSAGE);
                customArrayField.setText(null);
                goodToGo = false;
            }
       }
       
       if(initialValues.length > 15){
           JOptionPane.showMessageDialog(this,"Maximum array length is 15.",
                                            "Invalid Input",JOptionPane.WARNING_MESSAGE);
           customArrayField.setText(null);
           goodToGo = false;
       }
       
       else if(initialValues.length == 0){
           JOptionPane.showMessageDialog(this,"Array can not be empty.",
                                            "Invalid Input",JOptionPane.WARNING_MESSAGE);
           customArrayField.setText(null);
           goodToGo = false;
       }
       
       
       else if(goodToGo){
            //For testing
            this.setVisible(false);
            if(enableSecondSort){
                Step[][] steps1 = method1.solve(initialValues);
                Step[][] steps2 = method2.solve(initialValues);
                new SimulationFrame(steps1,steps2, method1.getName(), method2.getName());
            }
            else{
                Step[][] steps1 = method1.solve(initialValues);
                new SimulationFrame(steps1, method1.getName());
            }
            
      }
       
   }