added test cases and examples