added read data to each function and completed plot1.R code to produce plot1.png