Added init_script function