added a c++ definition for xTake