modified code to test case of 2