added a non notebook version of agb_flux, untested