replaced (almost) all calls to Rcpp::wrap with direct assignments of R-matrices