some tweaks to the initial script