Saving state, with some trepidation. Working mostly and ugly.