Completed code for plot2, uploaded image