Converted main to C++
Added creation of a thread via std::thread