upgraded from C to C++