adding require(Rcpp) to function