with test cases