R-function completed