Modified to obtain max num of workers from local