public static BigInteger eval0(String str)
  {
    // Initialize endVal to be the first number in the string.
    int endVal = 0;
   
    // Loop through the string, and depending on the symbol,
    // perform the mathematical operation that corresponds
    // to the symbol.
    for (int i = 0; i <= str.length() - 1; i++)
      {
        if (str.charAt(i) == '+')
          {
            endVal += Character.getNumericValue(str.charAt(i+=2));
          } // else if for +
        else if (str.charAt(i) == '-')
          {
            endVal -= Character.getNumericValue(str.charAt(i+=2));
          } // else if for -
        else if (str.charAt(i) == '*')
          {
            endVal *= Character.getNumericValue(str.charAt(i+=2));
          } // else if for *
        else if (str.charAt(i) == '/')
          {
            endVal /= Character.getNumericValue(str.charAt(i+=2));
          } // else if for /
        else if (str.charAt(i) == '^')
          {
            endVal = (int) Math.pow(Character.getNumericValue(str.charAt(i)),
                                    Character.getNumericValue(str.charAt(i+=2)));
          } // else if for ^  
        else if (str.charAt(i) == ' ')
          {
            endVal += 0;
          } // else if it is whitespace, do nothing essentially
        else
          {
            endVal += Character.getNumericValue(str.charAt(i));
          } // else
      } // for
    
    return BigInteger.valueOf(endVal);
  } // eval0 (String)