Added extern "C" for C++