Added option to dictate the number of worker threads spawned.