Better save_prov function