replaced number of cores by detectCores()