Updated to keep state.