don't rely on MSVC supported C++ (std::exception()) but use a standard
std::invalid_argument supported by other compilers ...
latest changes ... uncertainty down here. Commited to save the work.