changed underlying structure to C++