private void binData(boolean lPerformed) {
        double max;
        int bin;
        boolean performLaplace = false;
        min = max = data.get(0);
        for(double d : data)
            if(d>max)max=d;
            else if(d<min)min=d;
        
        interval = (max - min)/((double)numBins - 1.);
        
        for(double d : data)
        {    
            bin = (int)((d - min) / interval);
            if(bin > numBins - 1) bin = numBins - 1;
            bins[bin]++;
        }
        for(int i = 0; i< bins.length; i++)
            if (bins[i]==0)
                if(lPerformed)
                {
                    bins[i] = 1;
                    //System.out.println("Fixing the fix");
                }    
                else performLaplace = true;
        
        if(performLaplace)laplacianCorrection();
        
        clean = true;
                    
    }