Update state.m