add test code and documentation