add test code and comments