Updated method for determining number of CPU in the system.