added the plot code