R-Prog assignment 2