add more test cases and improve docu