Replaced multiprocessing with threading