use correct number of workers
Exit only after all threads have finished.
Improve performance by a factor of 500.