Added modified BinarySearch