changed how to generate each invBeam