add comments and tests.
fixed text.