rewrote script