code for plot 5