initial
C++ style
regression tested