minor mods to plotting code