WIP: Port to C++