cleaned up the plotting script