implemented binary search using recursion