updated plot function

added comments to the plot function to explain how it works. Also
changed to graph to use Green instead of red