Initial code added for saving the state of the app.