step now returns the new state.