complete assigment2 R code, 27072014_18_44