added omp parallel for directive