lots of changes; coincides with submission to CRAN