added openmp parallelization to all for loops