Chnaged binary search