using instance var instead of constant to define number of threads