public boolean isScramble(String C, String T) {
	    if (T.length() != C.length()) {
	        return false;
	    } else if (T.length() == 1) {
	        return T.charAt(0) == C.charAt(0);
	    } else {
	        for (int i = 1; i < T.length(); i++) {
	            String t1 = T.substring(0, i);
	            String t2 = T.substring(i);

	            String c1 = C.substring(0, t1.length());
	            String c2 = C.substring(t1.length());
	            if (isEqualSet(t1, c1)) {
	                if (isScramble(t1, c1) && isScramble(t2, c2) ) {
	                    return true;
	                }
	            }

	            c1 = C.substring(0, t2.length());
	            c2 = C.substring(t2.length());
	            if (isEqualSet(t1, c2)) {
	                if (isScramble(t1, c2) && isScramble(t2, c1)) {
	                    return true;
	                }
	            }
	        }
	        return false;
	    }
	}