added example, fixed saveState