added betacurve to function saveoutput