Working fine for first scenario