Added C++ version