Add a save function.