More code converted to C++