Began R solution to problem 01