Adding code for plot 4