Rewrite of Lorei in C++