First code for pool C++ implementation