Final version of code snippet from Stephan T Lavavej video tutorial Core C++ part 3