added thread pool and fixed parallel solver