complete.R version1.0 of Assignment 1 Part 2