implement script generation