add state restoration
Merge pull request #1 from flatworld/512_state_restoration

add state restoration