private int strcmp(String s1, int i1, String s2, int i2) {
		int l1 = s1.length() - i1;
		int l2 = s2.length() - i2;

		int len = l1;
		boolean diff = false;

		if (len > l2) {
			len = l2;
		}

		while (len-- > 0) {
			if (s1.charAt(i1++) != s2.charAt(i2++)) {
				diff = true;
				break;
			}
		}

		if (diff == false && l1 != l2) {
			if (l1 > l2) {
				return s1.charAt(i1);
			} else {
				return -s2.charAt(i2);
			}
		}
		return s1.charAt(i1-1) - s2.charAt(i2-1);
	}