passeing numCores as param