work fine for the test cases