further tweaks to scripts to get legends right