Made changes to binary search