some tweaks to scripts and code