use threads instead of num threads