Skeleton of saving function