added code to count the number of cpu's