public double value()
    {
        ArrayList<Double> numbers = new ArrayList<Double>(values.size());
        for (int i = 0; i < values.size(); i++)
        {
            numbers.add(values.get(i).value());
        }
        for (int i = Operator.total_priorities(); i > 0; i--)
        {
            int skipped = 0;
            while (operators.size() > skipped)
            {
                if (operators.get(skipped).priority() == i)
                {
                    numbers.set(skipped, operators.get(skipped).calculate(numbers.get(skipped), numbers.get(skipped+1)));
                    numbers.remove(skipped+1);
                    operators.remove(skipped);
                }
                else
                {
                    skipped++;
                }
            }
        }
        return numbers.get(0);
    }