fixed the script; now to make it not stupid