tried to refactor for parallelization. Broke the parallel js file