Added basic save/restore functionality