save/restore implementation modified; should be able to compile
merging