merge baoyiqian's code