added second input argument to let user decide how many CPUs to use