added code to count the number of CPUs