minor revisions to save functions