a merge of shengwei's branch and chenjiong's branch