a failed attempt to use multiprocessing
convert multiprocessing code to subprocess