added thread pool implementation