ZER - Tried to add code to allow saving of state, not yet finished