rewrite. ready to save state.