Added code for plot 3