finished ch24 - saving and restoring application states