added code for IntegrateModeMedium to account for degenerate bundles