modify state.c