added some qa testing logic. qa.cpp.