reformat Jinfeng's code