added plot code