updated for CRAN submission
added examples for all functions