statefunctions