Courser R assignment 2