added a flag to adopt number of test functions