Incorporated Sheng's changes