Save output directly from function