added multithreading with openMP