Added C++ stuff to tpw.h