private boolean matchesHelper(subExpression thm, subExpression tbe) {
		if (thm.isVariable()) {
			return tbe.equals(subValues.get(thm.getName()));
		} else if (thm.getName().equals(tbe.getName())) {
			boolean lReturn = false;
			boolean rReturn = false;
			if (thm.getLeft() != null && tbe.getLeft() != null) {
				lReturn = matchesHelper(thm.getLeft(), tbe.getLeft());
			}
			if (thm.getRight() != null && tbe.getRight() != null) {
				rReturn = matchesHelper(thm.getRight(), tbe.getRight());
			}
			if (thm.getName().equals("~")) {
				rReturn = true;
			}
			return lReturn && rReturn;
		} else {
			return false;
		}
	}