refactored to use multiprocessing pools