First version of a (low-level) C++ implementation.