Add option to set number of cores