adding ncores argument to subset