tweak to plot1 code