Add code to get number of cores