ading the given test case
testetd few more test cases and fixed a few bugs