Add initial code for save states