Added std::thread::hardware_concurrency() to calcuate threads. Improved debug.