Adding code and plot for plot1.