private boolean encased(String s) {
		int countP = 0;		// count of parentheses, 1 for every '(', -1 for every ')'
		int matchedP = -1;  // index where the parentheses end up matching
		if(s.startsWith(NEGATIVE+"")) {  // if it starts with a negative sign, ignore the negative
			s = s.substring(1);
		}
	
		if(s.contains(PLEFT + "")) {	
			
			// increment count for every '(', decrement for every ')'
			// when the parentheses match, break out of the loop
			for(int i = 0; i < s.length(); i++) {
				if(			s.charAt(i) == PLEFT) {
					countP++;
				} else if(	s.charAt(i) == PRIGHT) {
					countP--;
				}
				if(countP == 0) {
					matchedP = i;
					break;
				}
			}
		}
		// if they matched only at the end, and there were an equal number of left and right
		// parentheses, then return true, this is encased
		if(matchedP == s.length()-1 && countP == 0) {
			return true;
		} else if(countP != 0 ) {	// mismatched parentheses if count isnt equal
			throw new IllegalArgumentException("Mismatched parentheses.");
		} else {
			return false;
		}
	}