saving/restoring state implemented. However, could not test restoration