2nd. version: extended the test cases, added runSingleTest