initial work on saving the document