Ported on C++