update sample code of extended states