cleaned up for CRAN