added automatic script generation