Rewrote entire script