I tried to return the right index of an array element with a recursive binary search algorithm, however it returns just the index of the portion taken into consideration.