attempting to shift over to C++ implementation of mesh simplification