added pthreads