added support for choosing number of CPUs