Work on C++ version
Signed-off-by: Zeklandia <awood5659@gmail.com>