Added documentation and compiled into an R-package.