Switched from threading to multiprocessing for improved performance.