added basic R functions