comments and input test cases added