added openmp for threading