switched to using multiprocessing pool for optimal performance