Start rewrite on c++