implemented test run function.