Part3  of programming assignment in R-1