Improved GeneralizedBeam.