Added some ugly code

Added some ugly C++ and C code