started some work to write it back out to disk, but unfinished and untested