some code and docs. sync from baidu