added multithreading with OpenMP