Works for all test cases now