update haohan's code