worked on RProgramming Assignment2