changes to plot3.R and plot4.R