public static double evalPostfix(LinkedList<String> expression) {
		Stack<Double> operandStack = new Stack<Double>();

		try {
			for (String s : expression) {
				if (s.equals("+")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(op1 + op2);
				} else if (s.equals("-")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(op1 - op2);
				} else if (s.equals("*")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(op1 * op2);
				} else if (s.equals("/")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(op1 / op2);
				} else if (s.equals("%")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(op1 % op2);
				} else if (s.equals("^")) {
					double op2 = operandStack.pop();
					double op1 = operandStack.pop();
					operandStack.push(Math.pow(op1, op2));
				} else {
					operandStack.push(Double.parseDouble(s));
				}
			}
		} catch (Exception e) {
			System.out.println("Evaluation of postfix expression failed");
		}

		if (operandStack.size() > 1) {
			System.out.println("Expression contains incorrect operators");
		}

		if (operandStack.size() == 0) {
			return 0.0;
		}

		return operandStack.pop();
	}