rewriting to c++03