using openMP to speed up