added codes to create plots and png files of plots