Moved C++ implementation back