private static Double performOp(String i1, String i2, String sop) {
		char op = sop.charAt(0);
		double a = Double.valueOf(i1);
		double b = Double.valueOf(i2);
		 switch (op)
	        {
	        case '+':
	            return (double) (a + b);
	        case '-':
	            return (double) (b - a);
	        case '*':
	            return (double) (a * b);
	        case '/':
	            if (b == 0)
	                throw new
	                UnsupportedOperationException("Cannot divide by zero");
	            return (double) (b / a);
	        case '^':
	        	return Math.pow(a, b);
	        }
	        return 0.0;
	}