added multiprocessing support