added task 2 with r script