adding parameterization to run with 1 to num_cores threads