working on parallelization. not complete