Assignment 2 for r progr