nthreads option implemented