modifications for rpackage