completed plot2.R