Moved all functions to /R