Code and plot for 2nd question