@Override
    public Question findOutlier()
    {
        //sort the list
       boolean done = false;
       int i = 1; 
       while(i < eval.getDatapoints().size() && !done)
            {
                done = true;//gets changed IF a swap occurs
                for(int j = 0; j< eval.getDatapoints().size() - (i); j++)
                {
                    if(eval.getDatapoints().get(j).getValueY() > eval.getDatapoints().get(j+1).getValueY())
                    {
                      
                        eval.getDatapoints().add(j, eval.getDatapoints().remove(j+1));
                 
                        

                      
                        done = false;//a swap happened so we're not done yet
                    }	
                }
                i++;
            }      

            
            double median = ( eval.getDatapoints().get(eval.getDatapoints().size()/2).getValueY() + eval.getDatapoints().get(1 + eval.getDatapoints().size()/2).getValueY() )/2; 
                   
            int q1 = eval.getDatapoints().size()/4;
            int q3 = 3*(q1);
            
            double iqr = eval.getDatapoints().get(q3).getValueY() - eval.getDatapoints().get(q1).getValueY();
            
            String answer = "";
            
            double upperRange = eval.getDatapoints().get(q3).getValueY() + (1.5*iqr);
            double lowerRange = eval.getDatapoints().get(q1).getValueY() - (1.5*iqr);
            
            for(int k = 0; k < eval.getDatapoints().size(); k ++)
            {
                
                //if > q3+1.5*iqr
                //if < q1-1.5*iqr
                //its an outlier
               
                         
                if( eval.getDatapoints().get(k).getValueY() < lowerRange  || eval.getDatapoints().get(k).getValueY() >  upperRange)
                {//this is an outlier
                    answer = answer + " " + eval.getDatapoints().get(k).getValueX().toString();
                }
                
            }
            
        //create a new question object 
        Question newQuestion = new Question("Find any outliers.", 45, "s", 0);
        
        if(answer.isEmpty())
        {
            answer = "No Outliers";
        }
        
        
        newQuestion.setAnswer(answer);
        return newQuestion;
    }