change from C++ to C