Assignment 2 solutions

completed working R code for assignment 2 by Lokesh