Switched from using std::stoi to std::atoi since stoi is only C++11.