adding mutlthreading support for two point function