updated for new Rcpp