Working for all test cases