merge Da Ye's code