making it an R package
merging changes