added an example and plot code