 		}
 		else
 		{
-			return nil
+			assert(value == sequence[middle])
+			return value
 		}
 	}
 


	let middle = midpoint(min, max);

	if value == sequence[middle]
	{
		return value
	}
	else if value < sequence[middle]
	{
		return binarySearchInRange(sequence, value, min, middle - 1)
	}

	}
	else
	{
		assert(value == sequence[middle])
		return value
	}
}

