Some useful C++ code I may use