added R stuff