add comments and tests.