added save and restore function, only working for ascon atm