Updating set_state.php one function at the time