Merge guantao's code