added test cases and code