[xhuang] finish function.