added more test
fixed the bug as per required
modified the test cases as per required