Update to plotting code