private int binarySearch(int[] A, int target, int start, int end) {
		int mid = (start + end) / 2;
		if (target == A[mid]) {
			return mid;
		} else if (target > A[mid] && mid + 1 <= end) {
			if (target < A[mid + 1]) {
				return mid + 1;
			}
			return binarySearch(A, target, mid + 1, end);
		} else if (target < A[mid] && mid - 1 >= start) {
			if (target>A[mid-1]) {
				return mid;
			}
			return binarySearch(A, target, start, mid - 1);
		} else {
			return -1;
		}
	}