added compare function test case