added mc.cores argument to mclapply