changed how to calculuate numI0/I1inTreatment so it runs faster