converted to c++ header library