saving state; updated examples