R prog assignment 2