more test cases and few boundry conditions and debug prints