Changed Stephens1997a into a full C++ function.