Compute BetweenBB without a loop