more work on updating state