public static boolean isParenthesized(String inputString) {
		// returning false if the input string is empty
		if (inputString.isEmpty()) return false;
		// index of the input String's last character
		int lastIndex = inputString.length() - 1;
		// The String may only be parenthesized, if it starts with a left 
		// parenthesis and ends with a right one.
		if (inputString.charAt(0) == '(' && 
				inputString.charAt(lastIndex) == ')') {
			// removing the first and the last parentheses from the String
			inputString = inputString.substring(1, lastIndex);
			// number that states, how many left parentheses that have to get a
			// right one have been found
			int leftPars = 1;
			// variable for the current character
			char currentChar;
			// going through the String between the two outer parentheses
			while (!inputString.isEmpty()) {
				currentChar = inputString.charAt(0);
				// increasing the number of left parentheses by one in case of 
				// a left parenthesis
				if (currentChar == '(') leftPars++;
				// decreasing the number of left parentheses by one in case of 
				// right parenthesis
				if (currentChar == ')') {
					leftPars--;
					// If the number of left parentheses is less than one, the 
					// first one has been closed and therefore the entire 
					// String isn't parenthesized.
					if (leftPars < 1) return false;
				}
				// removing the first character from the input String
				inputString = inputString.substring(1);
			}
			// If there is exactly one left parenthesis left to be closed, its 
			// the first one and the String is parenthesized. Otherwise the 
			// String isn't even a valid String to represent a Formula.
			return leftPars == 1;
		}
		// If the String doesn't start with a left parenthesis and end with a 
		// right one, it isn't parenthesized.
		else return false;
	}