implement SavedStates with Stack