added pkl saving of all globals and params