got Jeff code to work properly within ctest