adopted some test cases