refactoring : now runs all the test cases