Fang's code