add test code, clean-up doc details