test app reimplemented in C++