Finished version ready for CRAN