tested speed, added multiprocessing