public double calculate() {
		double ans = 0, a, b;
		b = Double.valueOf(elementList.pop());
		a = Double.valueOf(elementList.pop());

		switch (elementList.pop()) {
		case "+":
			ans = a + b;
			break;
		case "-":
			ans = a - b;
			break;
		case "*":
			ans = a * b;
			break;
		case "/":
			ans = a / b;
			break;
		default:
			break;
		}
		elementList.push(String.valueOf(ans));
		return ans;
	}