fix up based on Chi xinze's comments