more test cases written and cut and tail code changes made