Adding code for plot2