Updated multiprocessing code.