Works for first test case