Fixed code for each test cases