adds algorithm for determining number of workers