public ArrayList<Double> barHeight() {
        ArrayList<Double> values;
        values = A;
        ArrayList<Double> barDimen = new ArrayList<Double>(); //Convert to ArrayList
        double numBars = n;
        double sum = 0; //Sum of values 
        //double classNum = 0; //Number of classes: sum of values divided by number of bars

        //ArrayList<Double> clone = (ArrayList<Double>)values.clone(); //works if all values are consecutive
        //Collections.sort(clone); //couldnt just sort the values, caused some lcl ucl values to encapsulate a larger amount of values than other classes
        ArrayList<Double> clone = new ArrayList<Double>();

        for(int i = 0; i < values.size();i++)//creates consecutive values that can be used for calculating amount of values for each class
        {
            clone.add((double)i);
        }

        int[] width = new int[(int)numBars];//holds the sizes that each class can hold

        double lower = 0;

        double w = barWidth(lower, values.size(), numBars);

        double upper = lower + w;

        double last = -1;

        //Calculates the amount of values to place into each bin (class)
        for (int i = 0; i < width.length; i++) {
            //System.out.println("i: " + i);
            for (int j = 0; j < clone.size(); j++) {
                //System.out.println("j " + j);

                if (clone.get(j) >= lower && clone.get(j)<= upper) {

                    if (clone.get(j) == last) {}
                    else {

                        width[i]++;

                        last = clone.get(j);

                    }//end else

                }//end if

            }//end for

            lower+= w;
            upper+= w;

        }//end for
        //End of Calculating amount of values for each bin

        int count = 0;
        for (int i = 0; i < width.length; i++) {
            for(int j = 0; j < width[i]; j++)
            {
                sum += values.get(count);
                //System.out.println("Class Number " + i + " value "+ j +":\t" + values.get(count)+ "\t+=\t"+sum);//for testing
                count++;
            }
            //System.out.println("BarHeight["+i+"]:\t" + sum); //for testing

            //classNum = sum/width[i];    //The average value for the class
            //barDimen.add(classNum);
            barDimen.add(sum);              //all values in class summed together

            sum = 0;
        }

        return barDimen;
    }