max and min in Rcpp done!