commiting new changes to r code for assignment 2