Code and plot for plot 1