rewrote some code for C++