Function R added.