State saving and restoration proof of concept, it actually works :-)