updates to plotting code