recoded plot1.R