Hao's code