sunny added some explanation on the plotting function