Move the pool management back into the main function,
and add code to handle gracefully ctrl+c while running
things in parallel.