added the script (probably lightly broken at this point)