more tweaks to python script