Added R solution for 002