adding multiprocessing to the code