add test code and document