add imperative style script
先用命令式重写；再用函数式重写两次额
better doc and variable nnames