parallelized version working