complete with good test cases