modifications to plotting script