Some C++ code I use