Added modified binary search