Added script initialization function