added the solution of the R assignment.