implemented thread pool. not using it yet.
ops, failed to set num_threads in ThreadPool
multithreadededit