Added toString to allow saving and loading of state.