trying to merge with yiwei, still some bugs