private static Pair<Integer, Integer> findNest(String value, int target, boolean fromEnd){
		int lastFound = Integer.MIN_VALUE;
		int nest = 0;
		for(int i = 0; i < value.length(); i++){
			int search = fromEnd ? value.length() - 1 - i : i;
			if(value.charAt(search) == '('){
				nest++;
			}
			else if(value.charAt(search) == ')'){
				nest--;
				if(target == nest){
					lastFound = search;
				}
			}
		}
		return new Pair<Integer, Integer>(nest, lastFound);
	}