update inner code, add test cases