reworked script.sh to make it suck less