Final R Package with edits